﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NET.Action
{
    [TestClass]
    public class Main
    {
        [TestMethod]
        public void ActionTest()
        {
            var mouse = new AnimalWithAction("mouse");

            var cat = new AnimalWithAction("cat")
            {
                Eat = (obj) =>
                {
                    Console.WriteLine($"\teat {obj.Name}");
                },
                Catch = (obj) =>
                {
                    return $"\tcan catch {obj.Name}";
                }
            };
            cat.Info(mouse);


            var dog = new AnimalWithAction("dog")
            {
                Eat = (obj) =>
                {
                    Console.WriteLine($"\tdon't eat {obj.Name}");
                },
                Catch = (obj) =>
                {
                    return $"\tplay with {obj.Name}";
                }
            };
            dog.Info(cat);

        }
    }
}
